package com.lingchen.enums;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Author    lingchen
 * Email     838878458@qq.com
 * Time      2017/11/29
 * Function  菜单
 */
public enum MenuEnum {
    MENU_EXAM(0, "考试"),
    MENU_EXERCISE(1, "练习"),
    MENU_COLLECT(2, "收藏"),
    MENU_CHOICE(3, "添加题目"),
    MENU_ERROR(4, "错题集");

    private int code;
    private String name;

    MenuEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @JsonValue
    public int getCode() {
        return code;
    }

    @JsonValue
    public String getName() {
        return name;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "MenuEnum{" +
                "code=" + code +
                ", name='" + name + '\'' +
                "} " + super.toString();
    }
}
